#include <stdio.h>

void print(int a, int b,int c) 
{
	int count = 5;
	for (int i=a,j=0;i<=b;i++) 
	{
		if (i % c == 0) 
		{
		printf("%-4d", i);
		j++;
		}
		if (j == count) 
		{
			printf("\n");
			j = j - 5;
		}
	}
}
int main() 
{
	int a, b, c;
	scanf_s("%d %d %d",&a,&b,&c);
	print(a,b,c);
	return 0;
}